package com.wangc.study.functionref;

import java.util.function.Function;
import java.util.function.Supplier;

/**
 * @author wangC
 * @create 2020-05-19 下午10:40
 * 方法的引用--静态方法的调用
 **/
public class FountionRefTest1 {

    public static void main(String[] args) {

        //静态方法的调用
        Supplier<String> s1 = ()->FountionRefTest1.put();
        System.out.println(s1.get());

        Supplier<String> s2 = FountionRefTest1::put;
        System.out.println(s2.get());

        Supplier<String> s3 = Test::test;
        System.out.println(s3.get());
    }


    static String put() {
        System.out.println("put");
        return "put...";
    }


}

class Test{

    public static String test() {
        return "Test.test";
    }

}